Skip to content

fix(geolocation-controller): point to API Platform geolocation-api instead of legacy Ramps endpoint#9415

Closed
amitabh94 wants to merge 2 commits into
MetaMask:mainfrom
amitabh94:fix/geolocation-controller-repoint-api-platform-endpoint
Closed

fix(geolocation-controller): point to API Platform geolocation-api instead of legacy Ramps endpoint#9415
amitabh94 wants to merge 2 commits into
MetaMask:mainfrom
amitabh94:fix/geolocation-controller-repoint-api-platform-endpoint

Conversation

@amitabh94

@amitabh94 amitabh94 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Explanation

GeolocationApiService (used by Ramp, Perps, Rewards, Card, mUSD, and Money Account across extension and mobile) still fetches from the legacy Ramps-owned on-ramp.{env}api.cx.metamask.io/geolocation endpoint.

That endpoint is slated for deprecation now that geolocation is a platform-owned concern — see internal Slack context. API Platform's replacement, geolocation.{env}api.cx.metamask.io/v1/geolocation, has been live since March and returns the same plain-text ISO 3166-2 response format, so this is a same-contract URL swap with no consumer-facing changes.

Open item before merge

API Platform has not yet provisioned a dedicated UAT deployment for geolocation-api (confirmed: geolocation.uat-api.cx.metamask.io does not resolve, and the UAT workload config in va-mmcx-geolocation-api-workload is empty). This PR temporarily maps Env.UAT to the production URL so UAT testing isn't broken by this change. That mapping should be revisited once a real UAT deployment exists.

Opening as draft pending confirmation from API Platform (@api-platform-devs) that:

  • the PROD/DEV URLs are correct and stable
  • the UAT-points-at-PROD interim approach is acceptable on their end

References


Note

Medium Risk
Geolocation is shared across multiple products (Ramp, Perps, Rewards, etc.); a wrong host or UAT→prod mapping could affect regional behavior, though the response contract is intended to stay the same.

Overview
GeolocationApiService now calls API Platform’s geolocation-api instead of the legacy Ramps on-ramp geolocation host, ahead of that endpoint’s deprecation. The path changes from /geolocation to /v1/geolocation, and hosts move from on-ramp.{env}api.cx.metamask.io to geolocation.{env}api.cx.metamask.io (DEV still uses the dev- prefix). Response handling and caching are unchanged.

UAT no longer uses a separate UAT URL because API Platform has not deployed geolocation-api there yet; Env.UAT temporarily uses the production geolocation URL. Tests and the changelog document that interim mapping.

Reviewed by Cursor Bugbot for commit 73d9472. Bugbot is set up for automated code reviews on this repo. Configure here.

amitabh94 added 2 commits July 7, 2026 12:42
…stead of legacy Ramps on-ramp endpoint

GeolocationApiService still called the Ramps-owned
on-ramp.{env}api.cx.metamask.io/geolocation endpoint, which is slated for
deprecation now that geolocation is a platform-owned service. Repoint at
geolocation.{env}api.cx.metamask.io/v1/geolocation instead. Same response
contract (plain-text ISO 3166-2 code), so no consumer-facing changes needed.

UAT temporarily resolves to the production URL since API Platform has not
yet provisioned a dedicated UAT deployment for this service.

@Cal-L Cal-L left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@amitabh94

Copy link
Copy Markdown
Contributor Author

Closing in favor of #9417 — opened the branch directly on MetaMask/core instead of from a fork, since that's what broke the changelog-diff CI check here.

@amitabh94 amitabh94 closed this Jul 7, 2026
@amitabh94 amitabh94 temporarily deployed to default-branch July 7, 2026 18:39 — with GitHub Actions Inactive
pull Bot pushed a commit to dmrazzy/core that referenced this pull request Jul 7, 2026
…stead of legacy Ramps endpoint (MetaMask#9417)

## Explanation

`GeolocationApiService` (used by Ramp, Perps, Rewards, Card, mUSD, and
Money Account across extension and mobile) still fetches from the legacy
Ramps-owned `on-ramp.{env}api.cx.metamask.io/geolocation` endpoint.

That endpoint is slated for deprecation now that geolocation is a
platform-owned service. API Platform's replacement,
`geolocation.{env}api.cx.metamask.io/v1/geolocation`, has been live
since March and returns the same plain-text ISO 3166-2 response format,
so this is a same-contract URL swap with no consumer-facing changes.

## Open item before merge

API Platform has **not yet provisioned a dedicated UAT deployment** for
`geolocation-api` (confirmed: `geolocation.uat-api.cx.metamask.io` does
not resolve, and the UAT workload config in
`va-mmcx-geolocation-api-workload` is empty). This PR temporarily maps
`Env.UAT` to the production URL so UAT testing isn't broken by this
change. That mapping should be revisited once a real UAT deployment
exists.

Opening as **draft** pending confirmation from API Platform
(`@api-platform-devs`) that:
- the PROD/DEV URLs are correct and stable
- the UAT-points-at-PROD interim approach is acceptable on their end

## References

- `packages/geolocation-controller` is owned by
`@metamask-mobile-platform` per CODEOWNERS
- API Platform docs: https://docs.cx.metamask.io/api/geolocation/

Supersedes MetaMask#9415 (opened from a fork by mistake, which broke the
changelog-diff CI check).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Wide downstream use (Ramp, Perps, Rewards, etc.) makes any geolocation
outage impactful, though the API contract is unchanged; UAT hitting
production is an interim operational caveat.
> 
> **Overview**
> **`GeolocationApiService`** now calls API Platform’s
**`geolocation-api`** host and **`/v1/geolocation`** path instead of the
legacy Ramps **`on-ramp.*`** **`/geolocation`** URLs that are being
deprecated. The response contract is unchanged (plain-text ISO 3166-2).
> 
> **`getGeolocationUrl`** builds
**`https://geolocation.api.cx.metamask.io`** for production and UAT, and
**`https://geolocation.dev-api.cx.metamask.io`** for DEV. **UAT** no
longer uses a separate **`uat-`** host and temporarily shares the
production URL until API Platform provisions a UAT deployment. Tests and
the changelog reflect the new URLs and UAT behavior.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
411259b. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants